<template>
    <BasePanel width="388px" height="144px" title="生态">
        <template #default>
            <div class="panel-content">
                <div v-for="item in panelState" :key="item.label" class="item">
                    <div class="label">{{ item.label }}</div>
                    <div class="value-box">
                        <span class="value">{{ item.value }}</span>
                        <span class="unit">{{ item.unit }}</span>
                    </div>
                </div>
            </div>
        </template>
    </BasePanel>
</template>

<script setup lang="ts">
import BasePanel from '@/components/BasePanel/index.vue'
import dayjs from 'dayjs'
// import { useGlobalStore } from '@/store/global'
// import { getFpiAssetsFile } from '@/utils/tools'

// 全局数据
// const globalStore = useGlobalStore()

// 年份时间
const year = dayjs().year()
// 数据
const panelState = shallowRef([
    {
        label: `红线面积(${year}年)`,
        value: 4693.5,
        unit: '万吨CO2',
    },
    {
        label: `森林覆盖率(${year}年)`,
        value: 65.74,
        unit: '%',
    },
])
</script>

<style lang="scss" scoped>
.panel-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 12px;

        .label {
            font-size: 18px;
            font-weight: 700;
            line-height: 18px;
            color: rgba(255, 255, 255, 1);
            height: 18px;
        }

        .value-box {
            display: flex;
            align-items: flex-end;
            gap: 4px;

            .value {
                font-size: 28px;
                font-weight: 400;
                line-height: 28px;
                color: rgba(1, 254, 133, 1);
                height: 28px;
                font-family: Oswald;
            }
            .unit {
                font-size: 16px;
                font-weight: 700;
                line-height: 16px;
                height: 16px;
                color: rgba(255, 255, 255, 1);
            }
        }
    }
}
</style>
